package br.urca.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author Lucas
 */
@Embeddable
public class BiItensReservaPK implements Serializable {
	
	private static final long serialVersionUID = 1L;

	@Column(name = "COD_RESERVA")
    private String codReserva;

    @Column(name = "COD_ITEM")
    private short codItem;

    public BiItensReservaPK() { }

    public BiItensReservaPK(String codReserva, short codItem) {
        this.codReserva = codReserva;
        this.codItem = codItem;
    }

    public String getCodReserva() {
        return codReserva;
    }

    public void setCodReserva(String codReserva) {
        this.codReserva = codReserva;
    }

    public short getCodItem() {
        return codItem;
    }

    public void setCodItem(short codItem) {
        this.codItem = codItem;
    }

    @Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + codItem;
		result = prime * result
				+ ((codReserva == null) ? 0 : codReserva.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		BiItensReservaPK other = (BiItensReservaPK) obj;
		if (codItem != other.codItem)
			return false;
		if (codReserva == null) {
			if (other.codReserva != null)
				return false;
		} else if (!codReserva.equals(other.codReserva))
			return false;
		return true;
	}

	@Override
    public String toString() {
        return "model.BiItensReservaPK[ codReserva=" + codReserva + ", codItem=" + codItem + " ]";
    }
    
}
